package com.hzsd.zengbanyi.biaodan_text.bean;



import java.util.ArrayList;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class GroupDAO {
	private  Context context;
	public GroupDAO(Context context){
		this.context = context;
	}
//	public  String getGroupNameString(){
//		StringBuilder sb = new StringBuilder();
//		
//		DataBaseHelper helper = new DataBaseHelper(context);
//		SQLiteDatabase db = helper.getReadableDatabase();
//		
//		Cursor cursor = db.query("sys_Group", new String[]{"G_CName"}, null, null, null, null, null);
//		while(cursor.moveToNext()){
//			sb.append(cursor.getString(0));
//		}
//		db.close();
//		return sb.toString();
//	}
public ArrayList<Group> getGroupName(){	
	DataBaseHelper helper = new DataBaseHelper(context);
	SQLiteDatabase db = helper.getReadableDatabase();
	
	Cursor cursor = db.query("sys_Group", new String[]{"G_CName","GroupID"}, null, null, null, null, null);
	ArrayList<Group> listGroup = new ArrayList<Group>();
	while(cursor.moveToNext()){
		Group group =new Group();
	group.G_CName = cursor.getString(0);
	group.GroupID=cursor.getString(1);
	listGroup.add(group);
	}
	db.close();
	return listGroup;
	
}

	
	
	
	
	
	
	
}
